home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Environments / Prograph Classic 2.6.1 / Prograph Reference Manual / Prograph Reference 5-7 / Prograph Reference 5-7.rsrc / TEXT_159.txt < prev    next >
Encoding:
Text File  |  1995-10-25  |  2.7 KB  |  52 lines

  1.  
  2. Environment
  3.  
  4. The Environment primitives allow you to obtain information about the Macintosh hardware and software configuration in which the application is running. Use these primitives to test whether certain system features are present before attempting to execute code which may be incompatible with some configurations.
  5.  
  6. The trap? primitive is used to discover whether certain Macintosh toolbox calls are available on the current hardware and software configuration. Toolbox and Operating System routines on the Macintosh are referred to by a trap number, which is an index into the trap dispatch table which contains the actual addresses of the routines in ROM or the System file. The trap numbers corresponding to a particular toolbox call names are listed in tables in Inside Macintosh. 
  7.  
  8. There are several ways to check availability of a particular trap. You can call the Gestalt function to see if the appropriate version of the corresponding driver or manager is available. However, if the trap to be tested is not included in any particular manager, and there is no Gestalt selector code for that manager, or if you want to test for the availability of Gestalt itself, the trap? primitive is provided for testing the availability of a trap directly.
  9.  
  10.  
  11. _________________________________________________
  12.  
  13.                          gestalt     *267*
  14.  
  15.  
  16. Input types: integer
  17.  
  18. Output types: integer
  19.  
  20. Description: Gestalt Selectors and Responses are documented in Inside Macintosh. If the toolbox call Gestalt is available on the system:
  21.  
  22.  
  23.  the gestalt primitive calls Gestalt and returns the result; otherwise, gestalt simulates Gestalt for certain selectors by calling GetSysEnv. Response is a 4-byte integer which must be interpreted in different ways depending on the Selector. If Gestalt is not available on the system, and the requested information cannot be simulated with GetSysEnv, Response is 16#80000000.
  24.  
  25. See also: gestalt-attribute?
  26.  
  27.  
  28. _________________________________________________
  29.  
  30.                                                     gestalt-attribute?    *268*
  31.  
  32.  
  33. Input types: integer; integer
  34.  
  35. Output types: [ boolean ]
  36.  
  37. Description: Some Gestalt selectors return a value with bits set corresponding to what are known as attributes of that selector. This primitive tests the result of calling the toolbox routine Gestalt, and returns TRUE if the given Attribute is set; FALSE otherwise. To learn more about Gestalt Selectors, Attributes and Responses, see Inside Macintosh.
  38.  
  39. See also: gestalt
  40.  
  41.  
  42. _________________________________________________
  43.  
  44.                                           trap?     *268*
  45.  
  46.  
  47. Input types: integer
  48.  
  49. Output types: [ boolean ]
  50.  
  51. Description: Result is TRUE if the specified trap is implemented on the current configuration.
  52.